<?php if(isset($nocategory) && $nocategory == 'nocategory'){
	echo __d('store','Please select category.',true); 
}else{?>
<?php 	
	//echo $this->Form->input('StoreProduct.model_id',array('label'=>__d('store','Offer Type',true),'options'=>$storeModels,'empty'=>''));
	echo $this->Form->input('StoreModel.StoreModel',array('label'=>__d('store','Offer Type',true),'options'=>$storeModels,'empty'=>'','class'=>'_100'));		
?>
<table class="index" cellpadding="1" cellspacing="1">
<tr>
	<th>
		<input type="checkbox" id="selectAllTypes">
	</th>
	<th>
		<?php echo __d("store","Name",true)?>
	</th>
	<th>
		<div class="input text"><input type="text" size="2" id="inputAllInventory"></div>
	</th>
	<th>
		<?php echo __d("store","For",true)?>
	</th>
</tr>	
<tr>
	<td valign="middle" align="center">								
		<?php echo $this->Form->checkbox("StoreProduct.service", array('label'=>false,'after'=>false  ));?>
	</td>
	<td valign="middle" colspan="3">
		<?php echo __('Serice',true)?>
	</td>

</tr>
<?php 
$i = 0;
if(isset($storeTypes) && is_array($storeTypes) && !empty($storeTypes)){
$types = array();								
if(isset($this->data['StoreType']) && is_array($this->data['StoreType'])){
	foreach ($this->data['StoreType'] as $type) {
		$types[$type['id']]=$type['StoreProductType']['inventory'];
	}
}
	
foreach ($storeTypes as $key => $type) { 
	$type_id = $type['StoreType']['id'];
	$default_group = $type['StoreType']['default_group_id'];
	$name = $type['StoreType']['name'];
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}	
?>
<tr <?php echo $class;?>>
	<td valign="middle" align="center">								
		<?php echo $this->Form->checkbox("StoreType.type_id.{$type_id}", array('label'=>false,'after'=>false,'class'=>'selectedTypes' ));?>
	</td>
	<td valign="middle">
		<?php echo $name?>
	</td>
	<td valign="middle">
		<?php echo $this->Form->input("StoreType.inventory.{$type_id}",array('label'=>false,'size'=>2,'class'=>'selectedInventory'));?>
	</td>
	<td class="last" valign="middle">
		<?php echo $this->Form->input("StoreType.for_group.{$type_id}",array('label'=>false,'options'=>$storeTypeGroup,'empty'=>'','selected'=>$default_group,'hiddenField'=>false,'style'=>'width: 110px;'))?>
	</td>
</tr>
<?php }}?>
</table>
<?php }?>